<?php
header("Content-type:text/html;Charset=utf-8");

//子系统角色
class SubSystemOne{
    function mothedOne(){
        echo "方法一<br>";
    }
}
class SubSystemTwo{
    function mothedTwo(){
        echo "方法二<br>";
    }
}
class SubSystemThree{
    function mothedThree(){
        echo "方法三<br>";
    }
}

//外观角色
class Facade{
    private $subSystemOne = null;
    private $subSystemTwo = null;
    private $subSystemThree =null;

    function __construct(){
        $this->subSystemOne =new SubSystemOne();
        $this->subSystemTwo =new SubSystemTwo();
        $this->subSystemThree =new SubSystemThree();
    }

    function mothedA(){
        $this->subSystemOne->mothedOne();
    }
    function mothedB(){
        $this->subSystemTwo->mothedTwo();
    }
    function mothedC(){
        $this->subSystemThree->mothedThree();
    }
    function mothedD(){
        $this->subSystemOne->mothedOne();
        $this->subSystemTwo->mothedTwo();
        $this->subSystemThree->mothedThree();
    }
}

//测试
$facade = new Facade();
$facade->mothedA();
$facade->mothedB();
$facade->mothedC();
$facade->mothedD();
/*
 方法一
 方法二
 方法三
 方法一
 方法二
 方法三
 */